package com.report.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.report.component.WebMemberBrowseComponent;

import com.report.dto.request.WebMemberCollectReq;
import com.report.dto.response.WebMemberBrowseRes;
import com.report.service.IBrowseService;
import com.zmh.framework.util.Result;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 浏览
 * @author summer
 * @date 2024-06-28 23:57
 */
@RestController
@RequestMapping(value = "/webMemberBrowse")
@AllArgsConstructor
public class WebMemberBrowseController {

    private final IBrowseService browseService;




    /**
     * 会员浏览记录
     * @param webMemberCollectReq
     * @return
     */
    @PostMapping(value = "/memberBrowseList")
    public Result<Page<WebMemberBrowseRes>> memberBrowseList(@RequestBody WebMemberCollectReq webMemberCollectReq){
        webMemberCollectReq.setMemberId(Convert.convert(Integer.class,StpUtil.getLoginId()));
        Page<WebMemberBrowseRes>  page= browseService.findBrowseList(webMemberCollectReq);
        return Result.successResult(page);
    }
}
